#include <iostream>
using namespace std;

template<typename B, typename D>
struct IsBaseClass {
    struct No {};
    struct Yes {No no[2];};
    static Yes base(B*);
    static No base(...);
    const static int is = (sizeof(Yes) == sizeof(base(static_cast<D*>(0))));
};

class A {};
class B : public A {};
class C {};

int main() {
    cout << IsBaseClass<A, B>::is << endl;
    cout << IsBaseClass<A, C>::is << endl;
    return 0;
}
